package cn.itcast.service.stat.impl;

import cn.itcast.dao.stat.StatDao;
import cn.itcast.service.stat.StatService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;
@Service
public class StatServiceImpl implements StatService {
  @Autowired
  private StatDao statDao;
  /**
   * 统计生产厂家销量金额
   * @param companyId 用户所属公司
   * @return 返回ECharts需要的数据格式.Map的key是生产厂家，value是销售金额
   */
  @Override
  public List<Map<String, Object>> getFactoryData(String companyId) {
    return statDao.getFactoryData(companyId);
  }

  /**
   * 销售排行（统计前5名）
   *
   * @param companyId
   */
  @Override
  public List<Map<String, Object>> getSellData(String companyId) {
    return statDao.getSellData(companyId);
  }

  /**
   * 系统访问压力图
   *
   * @param companyId
   */
  @Override
  public List<Map<String, Object>> getOnlineData(String companyId) {
    return statDao.getOnLineData(companyId);
  }
}
